package com.wc.alorithm_luogu.P5739;

import java.util.Scanner;

/**
 * @Author congge
 * @Date 2023/4/24 10:59
 * @description https://www.luogu.com.cn/problem/P5739
 * 计算阶乘
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Main main = new Main();
        int num = sc.nextInt();
        System.out.println(main.factorial(num));
    }

    public int factorial(int num) {
        if (num == 1 || num == 0) {
            return 1;
        }
        return num * factorial(num - 1);
    }
}
